<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateUserTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">                
                    <h:outputLabel value="#{bundle.CreateUserLabel_name}" for="name" />
                    <h:inputText id="name" value="#{userController.selected.name}" title="#{bundle.CreateUserTitle_name}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_name}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_surname}" for="surname" />
                    <h:inputText id="surname" value="#{userController.selected.surname}" title="#{bundle.CreateUserTitle_surname}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_surname}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_email}" for="email" />
                    <h:inputText id="email" value="#{userController.selected.email}" title="#{bundle.CreateUserTitle_email}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_email}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_password}" for="password" />
                    <h:inputText id="password" value="#{userController.selected.password}" title="#{bundle.CreateUserTitle_password}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_password}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_phone}" for="phone" />
                    <h:inputText id="phone" value="#{userController.selected.phone}" title="#{bundle.CreateUserTitle_phone}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_phone}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_address}" for="address" />
                    <h:inputText id="address" value="#{userController.selected.address}" title="#{bundle.CreateUserTitle_address}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_address}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_city}" for="city" />
                    <h:inputText id="city" value="#{userController.selected.city}" title="#{bundle.CreateUserTitle_city}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_city}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_postalCode}" for="postalCode" />
                    <h:inputText id="postalCode" value="#{userController.selected.postalCode}" title="#{bundle.CreateUserTitle_postalCode}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_postalCode}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_type}" for="type" />
                    <h:inputText id="type" value="#{userController.selected.type}" title="#{bundle.CreateUserTitle_type}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_type}"/>
                    <h:outputLabel value="#{bundle.CreateUserLabel_country}" for="country" />
                    <h:inputText id="country" value="#{userController.selected.country}" title="#{bundle.CreateUserTitle_country}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_country}"/>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{userController.create}" value="#{bundle.CreateUserSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{userController.prepareList}" value="#{bundle.CreateUserShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index_old" value="#{bundle.CreateUserIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
